<?php

    class RatePlanCost
    {
        /**
         * @var string
         */
        public $ratePlan;

        /**
         * @var string
         */
        public $ratePlanPeriod;

        /**
         * @var float
         */
        public $cost;

        /**
         * @var int
         */
        public $idDiscount;

        /**
         * @var string
         */
        public $keyDiscount;

        /**
         * @var string
         */
        public $titleDiscount;

        public function Parse( XPathHelper $helper )
        {
            $this->ratePlan       = $helper->GetText("RatePlan");
            $this->ratePlanPeriod = $helper->GetText("RatePlanPeriod");
            $this->cost           = floatval($helper->GetText("Cost"));

            $helper->curNode = $helper->GetNode( "Discount", $helper->curNode );
            if ( $helper->curNode )
            {
                $this->idDiscount    = $helper->GetText("Id");
                $this->keyDiscount   = $helper->GetText("Key");
                $this->titleDiscount = $helper->GetText("Title");
            }
            else
            {
                $this->keyDiscount   = '';
            }
        }
    }

?>
